




C Reverse String: strrev()
The strrev(string) function returns reverse of the given string. Let's see a simple example of strrev() function.

#include
#include   
int main(){  
  char str[20];  
  printf("Enter string: ");  
  gets(str);//reads string from console  
  printf("String is: %s",str);  
  printf("\nReverse String is: %s",strrev(str));  
 return 0;  
}  

Output:

Enter string: javatpoint
String is: javatpoint
Reverse String is: tnioptavaj













Please Share





